package com.hzhr.iot.statis.convertor.custom;

import com.hzhr.iot.statis.convertor.DeviceDataExceptionConvertor;
import com.hzhr.iot.statis.entity.ext.DeviceDataExceptionEntityExt;
import com.hzhr.iot.statis.entity.ext.OptionsEntityExt;
import com.hzhr.iot.statis.model.deviceDataException.DeviceDataExceptionModel;
import org.springframework.stereotype.Service;

@Service
public class DeviceDataExceptionCustomConvertor extends DeviceDataExceptionConvertor {
    @Override
    public DeviceDataExceptionModel ext2deviceDataExceptionModel(DeviceDataExceptionEntityExt in) {
        DeviceDataExceptionModel result = super.ext2deviceDataExceptionModel(in);

        OptionsEntityExt ext1 = in.getExceptionTypeExt();
        if (ext1 != null) {
            result.setExceptionTypeDes(ext1.getDes());
        }

        return result;
    }
}

